<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>

<?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'product-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => array(
        'role' => 'form',
        'class' => 'form-horizontal',
        'enctype' => 'multipart/form-data'
    )
)); ?>

<p class="note">Fields with <span class="required">*</span> are required.</p>

<?php if ($model->getErrors()) {
    ?>
    <div class="alert alert-error">
        <button class="close" data-dismiss="alert" type="button"> ×</button>
        <?php echo $form->errorSummary($model); ?>
    </div>
<?php } ?>
<div class="form admin-main-wrapper">
    <div class="block block-themed block-last">
        <div class="block-title">
            <h4></h4>
        </div>
        <div class="block-content">
            <div class="row control-group">
                <?php echo $form->labelEx($model, 'name', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'code', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'code', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'model', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'model', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'price', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'price', array('size' => 60, 'maxlength' => 255)); ?>
                    Nhập luôn $. Ví dụ: $600.00
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'status', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'status', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'shipping_method', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->dropDownList($model, 'shipping_method', array(
                        'khách đến tận nơi' => 'khách đến tận nơi',
                        'có' => 'có'), array('style' => 'width:408px')); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'pay_online', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'pay_online', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'phone', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'phone', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'picture', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php if (!$model->getIsNewRecord() && $model->picture != '') { ?>
                        <img src="<?php echo HSUrl::home() . "/$model->picture" ?>" width="100px" alt=""/>
                    <?php } ?>
                    <?php echo $form->fileField($model, 'picture'); ?>
                </div>
            </div>

            <div class="row control-group buttons">
                <div class="controls">
                    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-default')); ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->endWidget(); ?>

